home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-01-17 | 3.4 KB | 95 lines |
- ' ************************************* Commands used:
- ' * * Td Stars Bank Td Stars Draw
- ' * Amcaf Examples * Td Stars Limit Td Stars Init
- ' * Td Stars 3 V1.0 * Td Planes Blitter Clear
- ' * Written by Chris Hodges * Td Accelerate Off Blitter Wait
- ' * * Td Gravity Pal Set
- ' ************************************* Td Move Pal Set Screen
- '
- ' Remove the mousepointer from screen.
- Hide
- ' Open a screen with 5 bitplanes.
- Screen Open 0,320,256,32,0
- Curs Off : Flash Off : Paper 0 : Cls 0
- ' Make it totally black.
- For A=0 To 31 : Colour A,0 : Next
- ' Correct the screen position.
- Screen Display 0,128,40,320,256
- ' Reserve the stars like usual. Note for turbo board users:
- ' Set the value as high as possible (400+).
- Extension_8_0A7E 9,100
- ' Limit the stars to a very small block.
- Extension_8_0A94 0,254 To 1,255
- ' Set the used planes to bitplane no. 0.
- Extension_8_0BCC 0,0
- ' Don't accelerate the stars (try it with 'on', it's marvellous!)
- Extension_8_0BAE
- ' Set the gravity to a rather normal value. Try 0,0 as alternative.
- Extension_8_0B78 0,3
- ' Init the stars. In this one pixel.
- Extension_8_0AD0
- ' Reset the limit to the full screen.
- Extension_8_0A94 0,0 To 319,255
- ' Switch to Double buffering
- Double Buffer : Autoback 0
- ' Now a very important part of the program: Creating the fade palettes.
- ' This is a very critical point because only one mistake can destroy the
- ' whole effect!
- ' First we have to reserve a small array for the five colours.
- Dim CO(4)
- ' Fill in the different hues.
- CO(0)=$4F4 : CO(1)=$3C3 : CO(2)=$292 : CO(3)=$161 : CO(4)=$30
- ' This is the main loop. We need five different palettes.
- For A=0 To 4
- ' And every colour must be set seperately.
- For C=0 To 31
- ' Init some values.
- AA=A : CO=0
- ' Check if the current colour must be displayed in front of all other
- ' bitplanes or only before four etc.
- For AAA=0 To 4
- Add AA,1,0 To 4
- ' This sets the colour. Try following alternatives:
- If( Extension_8_04F8(AA) and C)>0 Then CO=CO(4-AAA)
- ' If(Binexp(AA) and C)>0 Then CO=CO(AAA) : Exit
- ' If(Binexp(AA) and C)>0 Then CO=CO(4-AAA) : Exit
- ' If(Binexp(AA) and C)>0 Then CO=Mix Colour(CO,CO(4-AAA),0 To $FFF)
- Next
- ' Copy the colour to the palette buffer.
- Extension_8_14C6 A,C,CO
- Next
- Next
- Wait Vbl
- ' T is used for timing the next 'explosion point' and BP is a bitplane
- ' counter.
- T=0 : BP=0
- Repeat
- ' Clear the whole plane using the blitter because it's impossible
- ' to kill the 8 times older stars than they normally would be.
- Extension_8_121C 0,BP
- ' Set the explosion point to a new origin.
- If(T and 15)=0
- XM=Rnd(319) : YM=Rnd(128)
- Extension_8_0AB8 XM,YM
- End If
- ' And increase the timer.
- Inc T
- ' Move the Stars one step.
- Extension_8_0B48
- ' This is the main trick: Draw the stars on another bitplane each time.
- Extension_8_0BCC BP,BP
- ' Wait for blitter finished.
- Extension_8_1258
- ' And draw the new stars.
- Extension_8_0B64
- ' Chance the palette for this bitplane state.
- Extension_8_149E BP,0 : View
- ' Increase the bitplane pointer very second only because we are in
- ' double buffer mode.
- If T and 1 Then Add BP,1,0 To 4
- ' Swap the screens et voila!
- Screen Swap
- Wait Vbl
- Until Inkey$=Chr$(27) or Mouse Key<>0
- Screen Close 0
- End